<nz-row>
  <nz-col nzSpan="16">
    <button nz-button nzType="primary" (click)="toUpload()">
      <i nz-icon nzType="upload"></i>
      上传文件
    </button>
    &nbsp;&nbsp;&nbsp;&nbsp;
    <button nz-button nzType="primary" nzGhost="true" (click)="createFolder()"><i nz-icon nzType="folder-add"></i>新建</button>
    &nbsp;&nbsp;&nbsp;&nbsp;
    <nz-button-group>
      <button nz-button nzType="primary" nzGhost="true"><i nz-icon nzType="share-alt" nzTheme="outline"></i>分享</button>
      <!-- <button nz-button nzType="primary" nzGhost="true"><i nz-icon nzType="usergroup-add" nzTheme="outline"></i>共享</button> -->
      <button nz-button nzType="primary" nzGhost="true"><i nz-icon nzType="download" nzTheme="outline"></i>下载</button>
      <button nz-button nzType="primary" nzGhost="true"><i nz-icon nzType="delete" nzTheme="outline"></i>删除</button>
      <!-- <button nz-button nzType="primary" nzGhost="true"><i nz-icon nzType="copy" nzTheme="outline"></i>复制到</button> -->
      <button nz-button nzType="primary" nzGhost="true">更多操作</button>
      <!-- <button nz-button nzType="primary" nzGhost="true">移动到</button> -->
    </nz-button-group>
  </nz-col>
  <nz-col style="float: right;" nzSpan="4">
      <nz-input-group [nzSuffix]="search_icon"><input nz-input placeholder="搜索文件"></nz-input-group>
      <ng-template #search_icon><i nz-icon nzType="search"></i></ng-template>

  </nz-col>
  <nz-col>
    <button nz-button title="正序"><i nz-icon nzType="sort-ascending"></i></button>
  </nz-col>
  <nz-col>
    <button nz-button title="倒序"><i nz-icon nzType="sort-descending"></i></button>
  </nz-col>
  <nz-col>
    <button nz-button title="列表"><i nz-icon nzType="ordered-list" nzTheme="outline"></i></button>
  </nz-col>
  <nz-col>
    <button nz-button title="图标"><i nz-icon nzType="appstore" nzTheme="outline"></i></button>
  </nz-col>
</nz-row>
<nz-row style="padding-left: 6px;padding-top: 6px;padding-bottom: 6px;">
  <nz-col nzSpan="24" style="font-size: 9px;">
  <ng-container *ngIf="curPath==='/'; else elseTemplate">
    <a>全部文件</a>
  </ng-container>
  <ng-template #elseTemplate>
    <a style="margin-right: 5px;" (click)="parentPath()">返回上一级</a>|<a style="margin: 0 5px 0 5px;" (click)="toPath(0)">全部文件</a>&gt;
    <ng-container *ngFor="let item of paths;let idx=index;">
      <ng-container *ngIf="idx===paths.length-1; else elseTemplate">
        {{item.name}}
      </ng-container>
      <ng-template #elseTemplate>
        <a style="margin: 0 5px 0 5px;"(click)="toPath(idx+1)">{{item.name}}</a>&gt;
      </ng-template>


    </ng-container>

  </ng-template>
  </nz-col>
</nz-row>
<nz-row>
  <nz-col nzSpan="24">
  <nz-table #fileTable [nzData]="names" [nzLoading]="loading" [nzPageSize]="10000">
    <thead>
      <tr>
        <th nzWidth="40px" [nzChecked]="checkAll"></th>
        <th nzWidth="70%">名称</th>
        <th >大小</th>
        <th >修改日期</th>
      </tr>
    </thead>
    <tbody>
      <tr *ngFor="let item of fileTable.data" class="file_row">
        <td [nzChecked]="false"></td>
        <td>
          <ng-container *ngIf="item.namesType==='DIRECTORY'; else elseTemplate">
            <a (click)="childrenFolder(item)">
            <img src="/nars/assets/images/nars/folder.png">
            {{item.name}}</a>
          </ng-container>
          <ng-template #elseTemplate>
            <a target="_blank" [href]="root+'/nars/file/download.api?path='+encodeURI(item.path!)">
            <img nz-image [nzSrc]="'/nars/assets/images/nars/'+item.ext?.extName+'.png'" nzFallback="/nars/assets/images/nars/file.png">
            {{item.name}}
          </a>
          </ng-template>
          <nz-button-group style="float: right;" class="file_btn">
            <button nz-button nzType="text" title="分享"><i nz-icon nzType="share-alt"></i></button>
            <button nz-button nzType="text" title="下载"><i nz-icon nzType="download"></i></button>
            <button nz-button nz-popconfirm nzPopconfirmTitle="要删除目录或文件么？" nzType="text" title="删除"  (nzOnConfirm)="removePath(item)"><i nz-icon nzType="delete"></i></button>
          </nz-button-group>
          </td>
        <td>{{item.namesType==='DIRECTORY'?'-':''}}</td>
        <td>{{item.lastModifiedDateTime|date:'yyyy-MM-dd HH:mm'}}</td>
      </tr>
    </tbody>
  </nz-table>
</nz-col>
</nz-row>
